package com.wallet.provider.mapper;

import com.github.pagehelper.Page;

import com.wallet.provider.model.Menu;
import com.wallet.provider.model.vo.TreeNodeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MenuMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Menu record);

    int insertSelective(Menu record);

    Menu selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Menu record);

    int updateByPrimaryKey(Menu record);

    /**
     *
     * @param pageNum
     * @param pageSize
     * @param order
     * @param ordername
     * @return
     */
    Page<Menu> selectByPageNumSize(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize, String order, String ordername);


    List<Menu> selectByParentId(Long id);
    /**
     * 查询菜单树
     * @return
     */
    List<TreeNodeVo> selectMenuTree();

    /**
     *  根据角色id查询菜单树
     * @param roleId
     * @return
     */
    List<TreeNodeVo> selectMenuTreeByRoleId(Long roleId);

    /**
     * 根据角色id查询菜单
     * @param roleId
     * @return
     */
    List<Menu> selectMenuRoleId(Long roleId);

    /**
     * 删除菜单
     * @param ids
     * @return
     */
    int deleteByIds(Long[] ids);
}